<template>
	<view class="">
		<our-loading isFullScreen :active="active" text="loading..." background-color="#ffffff" />
		<image :src="bg" mode="widthFix" style="width:750rpx; height:360rpx;"></image>
		<view class="content">
			
			
			
              <view  style="height: 10px;"></view>
			  <u-alert-tips type="error"  :description="description"></u-alert-tips>
			<view class="uni-form-item uni-column" style="margin-top: 10px;">
				<view class="uni-input-wrapper">
					<input class="uni-input" type="text" placeholder="绑定卡号 如:NO.00020" v-model="card" />
				</view>
   
				<view class="uni-input-wrapper">
					<input class="uni-input" type="text" placeholder="您的姓名" v-model="title" />
				</view>
                <view class="uni-input-wrapper">
                	
					<input class="uni-input" disabled="disabled" @click="show=true" type="text" placeholder="请选择省市区"  v-model="area" />
					<!-- <u-picker mode="region" v-model="show" :area-code='["13", "1303", "130304"]'></u-picker> -->
					<u-picker mode="region" v-model="show" @confirm="confirm"></u-picker>
                </view>
				
				<view class="uni-input-wrapper">
					<input class="uni-input" type="text" placeholder="您的详细地址" v-model="address" />
				</view>
				
				
				<view class="uni-input-wrapper">
					<input class="uni-input" type="number" placeholder="您的手机号码" v-model="mobile" />
				</view>
                 <view class="uni-input-wrapper">
                 	<input class="uni-input" type="text" placeholder="您的身份证号码" v-model="code" />
                 </view>
				 <!-- <view class="uni-input-wrapper">
				 	<input   @click="show = true" class="uni-input" type="text" placeholder="您的出行时间" v-model="cdate" :disabled="true" />
				 </view>
				 
				 <u-picker v-model="show" mode="time" @confirm="confirm"></u-picker> -->
				 
				 
			<!-- 	<view class="uni-textarea">
					<textarea class="uni-t" placeholder="备注" v-model="content" />
					</view> -->
					<br>
					<view class="">
						<u-button type="primary" throttle-time="500" :loading="loading" @click="dd">立即提交</u-button>
					</view>
				
				   <view class="bz">{{bdesc}}</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		
		data() {
			return {
				area:"",
				region_value: [],
				code:"",
				address:"",
				show1:false,
				list: [],
				loading:false,
				bdesc:"",
				bg:"",
				set:{},
				show:false,
				description:"",
				type:1,
				cg:{},
				xx:{},
			  title:"",
			  cdate:"",
			  card:"",
			  mobile:"",
			  content:"",
			  zj:{},
			  active:true

			}
		},
		computed:{
					
		 },
		onLoad: function(e) {
			   
		    this.$u.post('set', {}).then(res => {
		    	this.active=false
		    	this.description=res.ydesc;
				this.bg=res.y_img;
				this.bdesc=res.bdesc
				this.list=res.list
		    	
		    });
			   
		},
		methods: {
			confirm11(e) {
			   
				this.address = e[0].label
			},
			confirm(e){
				this.area=e.province.label+e.city.label+e.area.label
				
			},
			
			dd(){
			
				if (this.card==""){
					this.msg("绑定卡号不能为空")
					return
				}
				if (this.title==""){
					uni.showToast({
					    title: '姓名不能为空',
						icon:"none"
					});
					return
				}
				if (!this.$u.test.mobile(this.mobile)) {
				
					 this.msg("手机格式不正确")
					return
				}
				
				if ( !(/(^\d{15}$)|(^\d{17}([0-9]|X)$)/.test(this.code)) ) {
				    this.msg('身份证格式不正确');
				    return false;
				  }; 
				// if (this.cdate==""){
				// 	this.msg("出行日期不能为空")
				// 	return
				// }
				
				this.loading=true
				this.$u.post('dd', {
					title:this.title,
					mobile:this.mobile,
					// content:this.content,
					card:this.card,
					address:this.area+this.address,
					 code:this.code
					
				}).then(res => {
					this.loading=false
					  if (res.code==1){
						  uni.showToast({
						     title: '提交成功'
						  });
					  }else{
						  
						 uni.showToast({
						     title: res.error,
						 	 icon:"none"
						 });
					 }
				})
				
			}
		}
	}
</script>
<style>
	@import url("@/common/uni.css");
	@import url("./index.css");
	.bz {
		text-align: center;
		box-sizing: border-box;
		margin: 0px auto;
		color: #999;
		width: 100%;
		line-height: 25px;
		font-size: 12px;
		padding: 10px;
		 margin-top: 10px;
		bottom: 10upx;
	}
</style>
